<template>
  <div v-if="data">
    <el-table :cell-class-name="changeOrder" :data="this.data" style="width: 100%" @row-click="getOrderId" label-class-name="order">
        <span id="order">
      <el-table-column prop="order_code_id" label="订单编号"   ></el-table-column>
      <el-table-column prop="order_id" label="订单号"> </el-table-column>
</span > 
      <el-table-column prop="order_renttime" label="取车时间" width="200"> </el-table-column>
      <el-table-column prop="order_returntime" label="还车时间" width="200"> </el-table-column>
      <el-table-column prop="order_price" label="订单价格" ></el-table-column>
      <el-table-column prop="order_success" label="订单状态"> </el-table-column>
    </el-table>
  </div>

</template>

<script>
export default {
  data() {
    return {
      data:null
    };
  },
  mounted () {
    let Uid = sessionStorage.getItem("UserID")
    // console.log(Uid)
    let params = `Uid=${Uid}`
    this.axios.post('/user/usergetorder',params)
    .then(res => {
      // console.log(res.data.data)
      this.data=res.data.data
    })
  },
  methods: {
    getOrderId(e) {
      // console.log(e.order_id)
      let Id = e.order_id
      this.$router.push(`/myorderdetail/${Id}`)
    },
    changeOrder({column}){
      // console.log(column)
      // if(column.id="el-table_7_column_37")
      return 'cursor: pointer'
    }
  },
};
</script>
<style scoped>
.order{
  cursor: pointer;
}
</style>
<style lang="scss" scoped>

</style>
